var _serviceURL = '/69mark/web';// 必须设置
$(function() {
	doPage(1);
});

function doPage(page){
	var vtype = $("#vtype").val();
	var sex = $("#sex").val();
	var mobile = $("#serchName").val();
	$.ajax({
   		type : "POST",
   		url : _serviceURL+"/toListOpenCity.do",
   		cache : false,
   		data : "pageNo="+page+"&pageSize=10",
   		dataType : 'json',
   		success : function(data) {
   			var result = "";
   			for(var i=0;i<data.menuList.length;i++){
			
   				result += "<tr>";
   				result += "<th>"+data.menuList[i].province+"&nbsp;&nbsp;"+data.menuList[i].city+"</th>";
   				result += "<td>";
   				result += "<a href=\"javascript:void(0);\" onclick=\"delfuncitem('"+data.menuList[i].bId+"');return false;\" title=\"删除\">删除</a>";
   				result += "</td>";
   				result += "</tr>";
   				result += "";
   				result += "";
   			}
   			
   			$("#open_id").html(result);
   			$("#page_user").html(data.navi);
   			
   		}
	})
	
}


function delfuncitem(thisid){
    layer.confirm('确定删除？',{btn:['确定','取消']},function(){
        $.ajax({
            type:'POST',
            url:_serviceURL+'/toOpenCityId.do',
            data:'thisid='+thisid,
            dataType : 'json',
            success:function(flag){
                if(flag==1){
                    layer.msg('删除成功',{
                        time: 2000,
                    });
                    doPage(1);
                 }else{
                     layer.msg('删除失败',{
                        time: 2000,
                      });
                 }
             }
         });
      });
 }


